import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
//直接载入在此载入，直接写在component中

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    name: "home",
    //按需载入在这个地方用箭头函数载入
    component: () => import("../views/home.vue")
  }
];

const router = new VueRouter({
  mode: "history",
  // base: process.env.BASE_URL,
  routes
});

export default router;
